package org.zjsru.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.zjsru.pojo.PaymentRecord;
import java.util.List;

public interface PaymentRecordMapper {
    @Insert("insert into tb_payment_record (payment_id, order_id, user_id, amount, status, callback_content, callback_time, create_time) " +
            "values (#{paymentId}, #{orderId}, #{userId}, #{amount}, #{status}, #{callbackContent}, #{callbackTime}, #{createTime})")
    int insert(PaymentRecord record);

    @Select("select * from tb_payment_record where order_id = #{orderId} order by create_time desc")
    List<PaymentRecord> findByOrderId(@Param("orderId") Long orderId);
} 